package com.qf.service.impl;

import com.qf.dao.impl.GoodsDaoImpl;
import com.qf.pojo.Goods;
import com.qf.service.GoodsService;

import java.util.List;

/**
 * @author Wy
 * @version V1.0
 * @Project javaWeb项目
 * @Package com.qf.service.impl
 * @Description:
 * @Date 2022/5/24 22:07
 */
public class GoodsServiceImpl  implements GoodsService {

    @Override
    public void addGoods(Goods goods) {
        GoodsDaoImpl goodsDao = new GoodsDaoImpl();
        goodsDao.insertGoods(goods);

    }
    /**
     * 查询商品表所有信息
     */

    @Override
    public List<Goods> findGoodsAll() {
        GoodsDaoImpl goodsDao = new GoodsDaoImpl();

        return goodsDao.findGoodsAll();
    }

    @Override
    public Goods findGoodsById(Integer id) {
        GoodsDaoImpl goodsDao = new GoodsDaoImpl();
        Goods byId = goodsDao.findById(id);

        return byId;
    }

}
